package com.jdd.modules.parkmonthly.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.jdd.common.util.excel.annotation.Excel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * @ClassName MonthlyDepartmentTreeModel
 * @Description TODO
 * @Author lenovo
 * @Date 2021/11/13 14:13
 * @Version 1.0
 **/
@Data
public class MonthlyDepartmentTreeModel implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 对应SysDepart中的id字段,前端数据树中的key
     */
    private String key;

    /**
     * 对应SysDepart中的id字段,前端数据树中的value
     */
    private String value;

    /**
     * 对应depart_name字段,前端数据树中的title
     */
    private String title;


    private boolean isLeaf;
    // 以下所有字段均与MonthlyDepartment相同

    /**
     * 主键id
     */
    @TableId(type = IdType.UUID)
    @ApiModelProperty(value = "主键id")
    private String id;
    /**
     * 父id
     */
    @Excel(name = "父id", width = 15)
    @ApiModelProperty(value = "父id")
    private String parentId;
    /**
     * 部门名称
     */
    @Excel(name = "部门名称", width = 15)
    @ApiModelProperty(value = "部门名称")
    private String departName;
    /**
     * 停车场编号
     */
    @Excel(name = "停车场编号", width = 15)
    @ApiModelProperty(value = "停车场编号")
    private String parkCode;
    /**
     * 停车场名称
     */
    @Excel(name = "停车场名称", width = 15)
    @ApiModelProperty(value = "停车场名称")
    private String parkName;
    /**
     * 部门类型(0:一级部门, 1:二级部门,2:三级部门)
     */
    @Excel(name = "部门类型(0:一级部门, 1:二级部门,2:三级部门)", width = 15)
    @ApiModelProperty(value = "部门类型(0:一级部门, 1:二级部门,2:三级部门)")
    private Integer departType;
    /**
     * 部门排序
     */
    @Excel(name = "部门排序", width = 15)
    @ApiModelProperty(value = "部门排序")
    private Integer sortNo;
    /**
     * 创建人
     */
    @Excel(name = "创建人", width = 15)
    @ApiModelProperty(value = "创建人")
    private String createBy;
    /**
     * 创建时间
     */
    @Excel(name = "创建时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "创建时间")
    private Date createTime;
    /**
     * 更新人
     */
    @Excel(name = "更新人", width = 15)
    @ApiModelProperty(value = "更新人")
    private String updateBy;
    /**
     * 更新时间
     */
    @Excel(name = "更新时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "更新时间")
    private Date updateTime;
    /**
     * 孩子节点
     */
    private List<MonthlyDepartmentTreeModel> children = new ArrayList<>();

}
